use List::Util qw(first max maxstr min minstr reduce shuffle sum); 
use Time::localtime;

srand;

sub get_cards
{
    foreach $_ qw(spade hearts clubs diamonds)
    {
	$group_number{$_} = int(rand 13) + 1 ;
    }
    return %group_number;
}

# build a hash of hashes

for $person qw (john mary peter rose)
{
    $HoH{$person} = {get_cards};
}

# access and print the hash
foreach $person (keys %HoH)
{
    print "$person: ";
    foreach(keys %{$HoH{$person}} )
    {
	print "($_,${$HoH{$person}}{$_} ) ";
    }
    print "\n";
}
